package com.atguigu.tingshu.album.client;

import com.atguigu.tingshu.album.client.impl.CategoryDegradeFeignClient;
import com.atguigu.tingshu.common.result.Result;
import com.atguigu.tingshu.model.album.BaseCategory3;
import com.atguigu.tingshu.model.album.BaseCategoryView;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;

import java.util.List;

/**
 * <p>
 * 产品列表API接口
 * </p>
 *
 * @author qy
 */
@FeignClient(value = "service-album", fallback = CategoryDegradeFeignClient.class)
public interface CategoryFeignClient {

   // api/album/category/getCategoryView/{category3Id}
   @GetMapping("api/album/category/getCategoryView/{category3Id}")
   public Result<BaseCategoryView> getBaseCategoryViewByCategory3Id(@PathVariable("category3Id") Long category3Id);

   // 远程调用 根据一级分类id查询三级分类列表
   // /api/album/category/findCategory3ListBycategory1Id/{c1Id}
   @GetMapping("/api/album/category/findCategory3ListBycategory1Id/{c1Id}")
   public Result<List<BaseCategory3>> findCategory3ListBycategory1Id(@PathVariable("c1Id") Long c1Id);

   // 远程调用获取所有的一级分类列表
   // /api/album/category/getBaseCategory1List
   // @Operation(summary = "获取所有的一级分类列表")
   @GetMapping("api/album/category/getBaseCategory1List")
   public Result<List<Long>> getBaseCategory1List();
}